#!/bin/bash
set -e

if [ "$1" = "kill" ]; then
  ps ax -o pid,command | grep "[p]ymobiledevice3 lockdown start-tunnel" | awk '{print$1}' | xargs kill -9
  ps ax -o pid,command | grep "[p]ymobiledevice3 remote start-tunnel" | awk '{print$1}' | xargs kill -9
elif [ "$1" = "start" ]; then
  pymobiledevice3 $2 start-tunnel --no-color --udid $3
fi

# @version: 2
